


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > BUserController</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">com.ie.controller.before</a>
</div>

<h1>Coverage Summary for Class: BUserController (com.ie.controller.before)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">BUserController</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    25%
  </span>
  <span class="absValue">
    (1/4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    14.3%
  </span>
  <span class="absValue">
    (1/7)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package com.ie.controller.before;
&nbsp;
&nbsp;import cn.hutool.captcha.CaptchaUtil;
&nbsp;import cn.hutool.captcha.CircleCaptcha;
&nbsp;import com.ie.common.http.ResponseResult;
&nbsp;import com.ie.common.security.anno.AuthIgrone;
&nbsp;import com.ie.common.security.utils.ConfigrarionBean;
&nbsp;import com.ie.common.security.utils.RedisUtil;
&nbsp;import com.ie.entity.before.BUserEntity;
&nbsp;import com.ie.service.before.BUserService;
&nbsp;import jakarta.servlet.ServletOutputStream;
&nbsp;import jakarta.servlet.http.HttpServletResponse;
&nbsp;import org.springframework.beans.factory.annotation.Autowired;
&nbsp;import org.springframework.web.bind.annotation.*;
&nbsp;
&nbsp;import java.io.IOException;
&nbsp;import java.util.Map;
&nbsp;
&nbsp;/**
&nbsp; * @classname: BUserController
&nbsp; * @Author: lzy
&nbsp; * @Description: //TODO
&nbsp; * @Date: 2025/4/21  13:53
&nbsp; * @Param:
&nbsp; * @version: 1.0
&nbsp; **/
&nbsp;@RestController
&nbsp;@RequestMapping(&quot;/api/before&quot;)
<b class="fc">&nbsp;public class BUserController {</b>
&nbsp;    @Autowired
&nbsp;    private BUserService bUserService;
&nbsp;    @Autowired
&nbsp;    private RedisUtil redisUtil;
&nbsp;    @Autowired
&nbsp;    private ConfigrarionBean config;
&nbsp;
&nbsp;    //注册
&nbsp;    @AuthIgrone  //永久
&nbsp;    @PostMapping(&quot;/register&quot;)
&nbsp;    public ResponseResult&lt;Map&lt;String, String&gt;&gt; register(@RequestBody BUserEntity bUserEntity) {
<b class="nc">&nbsp;        return bUserService.register(bUserEntity);</b>
&nbsp;    }
&nbsp;    //获取验证码
&nbsp;    @AuthIgrone
&nbsp;    @GetMapping(&quot;/getcode&quot;)
&nbsp;    public void getcode(HttpServletResponse response) throws IOException {
&nbsp;        //hutool工具实现，定义图形验证码的长、宽、验证码字符数、干扰元素个数
<b class="nc">&nbsp;        CircleCaptcha circleCaptcha = CaptchaUtil.createCircleCaptcha(116, 30, 4, 10);</b>
&nbsp;        //将验证码存入redis
<b class="nc">&nbsp;        redisUtil.set(&quot;code&quot;, circleCaptcha.getCode(), config.getRedisExpiration());</b>
&nbsp;        //获取HTTP响应的输出流
<b class="nc">&nbsp;        ServletOutputStream outputStream = response.getOutputStream();</b>
&nbsp;        //将生成的验证码图片写入到输出流中，从而发送到客户端浏览器
<b class="nc">&nbsp;        circleCaptcha.write(outputStream);</b>
&nbsp;        //关闭输出流，释放资源
&nbsp;        outputStream.close();
&nbsp;    }
&nbsp;    //登录
&nbsp;    @AuthIgrone
&nbsp;    @PostMapping(&quot;/login&quot;)
&nbsp;    public ResponseResult&lt;Map&lt;String, String&gt;&gt; login(@RequestBody BUserEntity bUserEntity) {
<b class="nc">&nbsp;        return bUserService.login(bUserEntity);</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-06-15 18:23</div>
</div>
</body>
</html>
